﻿<!--
<copyright company="Christoph van der Fecht - VDsoft">
Copyright (C) Christoph van der Fecht - VDsoft - All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited,
unless it is communicated and authorized by the copyright owner.
</copyright>
-->
<UserControl x:Class="SeriesManager.Controls.EpisodeManagerControl"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 mc:Ignorable="d" 
			 Height="350" 
			 Width="525"
			 MinHeight="350"
			 MinWidth="525"
			 DataContext="{Binding Path=EpisodeManagerView, Source={StaticResource ResourceKey=Locator}}">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="2*"/>
			<RowDefinition Height="8*"/>
			<RowDefinition Height="2*"/>
		</Grid.RowDefinitions>
		<!-- select season -->
		<StackPanel Orientation="Vertical"
					HorizontalAlignment="Center"
					Grid.Row="0" >
			<TextBlock Text="Series Folder"
					   FontSize="14"
					   Margin="2"/>
			<StackPanel Orientation="Horizontal">
				<TextBox Text="{Binding Path=SeasonPath, Mode=TwoWay}"
						 Margin="5"
						 FontSize="15"
						 Width="400"/>
				<Button Content="Browse..."
						Margin="5"
						Command="{Binding Path=BrowseSeasonCommand}"/>
			</StackPanel>
		</StackPanel>
		<!--selected series-->
		<Grid Grid.Row="1">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="1*"/>
				<ColumnDefinition Width="4*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="2*"/>
				<RowDefinition Height="9*"/>
			</Grid.RowDefinitions>
			<TextBlock Text="{Binding Path=Series.Name, Mode=OneWay}"
					   Grid.Row="0"
					   Grid.ColumnSpan="2"
					   FontSize="20"
					   Margin="5,5,5,2" />
			<!--Seassons-->
			<ListBox ItemsSource="{Binding Path=Series.Seasons, Mode=OneWay}"
					 SelectedValue="{Binding Path=SelectedSeason, Mode=TwoWay}"
					 HorizontalAlignment="Stretch"
					 MinWidth="100"
					 Grid.Row="1"
					 Grid.Column="0"
					 Margin="5">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<TextBlock Text="{Binding Number, Mode=OneWay, StringFormat=Season \{0\}}"
							   FontSize="15"
							   Margin="5"/>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
			<!--Episodes-->
			<ListBox ItemsSource="{Binding Path=SelectedSeason.Episodes, Mode=OneWay}"
					 Margin="5"
					 HorizontalAlignment="Stretch"
					 Grid.Row="1"
					 Grid.Column="1">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<StackPanel Orientation="Horizontal">
							<TextBlock Text="{Binding Path=Number, Mode=OneWay, StringFormat=Episode \{0\} - }"
								   FontSize="12"
								   Margin="2,2,0,2"/>
							<TextBlock Text="{Binding Path=Name, Mode=OneWay}"
								   FontSize="12"
								   Margin="2"/>
						</StackPanel>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
			<ProgressBar IsIndeterminate="True"
					 Grid.Row="1"
					 Visibility="{Binding Path=IsProgressbarVisible, Mode=OneWay}"
					 Margin="10,58,10,100" Grid.ColumnSpan="2"/>
		</Grid>
		<!--Rename-->
		<Button Content="Rename episodes"
				Command="{Binding Path=RenameEpisodesCommand}"
				Grid.Row="2"
				VerticalAlignment="Center"
				HorizontalAlignment="Center"
				FontSize="20"/>
	</Grid>
</UserControl>
